package com.jobson.model;

// Generated May 1, 2013 12:14:36 PM by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

/**
 * Customer generated by hbm2java
 */
@Entity
@Table(name = "Customer", catalog = "JobsonTally")
public class Customer implements java.io.Serializable
{

   /**
	 * 
	 */
	private static final long serialVersionUID = -933183766378619418L;
private Integer id;
   private Address address;
   private User userByModifiedBy;
   private User userByCreatedby;
   private String name;
   private boolean isDumy;
   private Date createdOn;
   private Date modifiedOn;
   private boolean isPublic;
   private String tin;
   private String pan;
   private Integer type;
   private boolean isDeleted;
   private int tableId;
   private Set<Bank> banks = new HashSet<Bank>(0);
   private Set<Bank> banks_1 = new HashSet<Bank>(0);

   // Flag indicate if update has to be called for Customer Table table 
   private boolean isUpdated = false;
   
   public Customer()
   {
	   this.tableId = 6;
   }

   public Customer(String name, boolean isDumy, boolean isPublic, boolean isDeleted, int tableId)
   {
      this.name = name;
      this.isDumy = isDumy;
      this.isPublic = isPublic;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
   }

   public Customer(Address address, User userByModifiedBy, User userByCreatedby, String name, boolean isDumy, Date createdOn, Date modifiedOn, boolean isPublic, String tin, String pan, Integer type, boolean isDeleted, int tableId, Set<Bank> banks, Set<Bank> banks_1)
   {
      this.address = address;
      this.userByModifiedBy = userByModifiedBy;
      this.userByCreatedby = userByCreatedby;
      this.name = name;
      this.isDumy = isDumy;
      this.createdOn = createdOn;
      this.modifiedOn = modifiedOn;
      this.isPublic = isPublic;
      this.tin = tin;
      this.pan = pan;
      this.type = type;
      this.isDeleted = isDeleted;
      this.tableId = tableId;
      this.banks = banks;
      this.banks_1 = banks_1;
   }

   public void setIsUpdated(boolean aValue) {
	   this.isUpdated = aValue;
}
   
   @Transient
   public boolean getIsUpdated(){
	   return isUpdated;
   }
   
   @Id
   @GeneratedValue(strategy = IDENTITY)
   @Column(name = "ID", unique = true, nullable = false)
   public Integer getId()
   {
      return this.id;
   }

   public void setId(Integer id)
   {
      this.id = id;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "Address")
   public Address getAddress()
   {
      return this.address;
   }

   public void setAddress(Address address)
   {
      this.address = address;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "ModifiedBy")
   public User getUserByModifiedBy()
   {
      return this.userByModifiedBy;
   }

   public void setUserByModifiedBy(User userByModifiedBy)
   {
      this.userByModifiedBy = userByModifiedBy;
   }

   @ManyToOne(fetch = FetchType.LAZY)
   @JoinColumn(name = "Createdby")
   public User getUserByCreatedby()
   {
      return this.userByCreatedby;
   }

   public void setUserByCreatedby(User userByCreatedby)
   {
      this.userByCreatedby = userByCreatedby;
   }

   @Column(name = "Name", nullable = false, length = 65535)
   public String getName()
   {
      return this.name;
   }

   public void setName(String name)
   {
      this.name = name;
   }

   @Column(name = "isDumy", nullable = false)
   public boolean isIsDumy()
   {
      return this.isDumy;
   }

   public void setIsDumy(boolean isDumy)
   {
      this.isDumy = isDumy;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "CreatedOn", length = 10)
   public Date getCreatedOn()
   {
      return this.createdOn;
   }

   public void setCreatedOn(Date createdOn)
   {
      this.createdOn = createdOn;
   }

   @Temporal(TemporalType.DATE)
   @Column(name = "ModifiedOn", length = 10)
   public Date getModifiedOn()
   {
      return this.modifiedOn;
   }

   public void setModifiedOn(Date modifiedOn)
   {
      this.modifiedOn = modifiedOn;
   }

   @Column(name = "IsPublic", nullable = false)
   public boolean isIsPublic()
   {
      return this.isPublic;
   }

   public void setIsPublic(boolean isPublic)
   {
      this.isPublic = isPublic;
   }

   @Column(name = "TIN", length = 65535)
   public String getTin()
   {
      return this.tin;
   }

   public void setTin(String tin)
   {
      this.tin = tin;
   }

   @Column(name = "PAN", length = 65535)
   public String getPan()
   {
      return this.pan;
   }

   public void setPan(String pan)
   {
      this.pan = pan;
   }

   @Column(name = "Type")
   public Integer getType()
   {
      return this.type;
   }

   public void setType(Integer type)
   {
      this.type = type;
   }

   @Column(name = "IsDeleted", nullable = false)
   public boolean isIsDeleted()
   {
      return this.isDeleted;
   }

   public void setIsDeleted(boolean isDeleted)
   {
      this.isDeleted = isDeleted;
   }

   @Column(name = "TableID", nullable = false)
   public int getTableId()
   {
      return this.tableId;
   }

   public void setTableId(int tableId)
   {
      this.tableId = tableId;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
   public Set<Bank> getBanks()
   {
      return this.banks;
   }

   public void setBanks(Set<Bank> banks)
   {
      this.banks = banks;
   }

   @OneToMany(fetch = FetchType.LAZY, mappedBy = "customer")
   public Set<Bank> getBanks_1()
   {
      return this.banks_1;
   }

   public void setBanks_1(Set<Bank> banks_1)
   {
      this.banks_1 = banks_1;
   }

}
